package com.String;


import java.util.Scanner;

public class Stringb {
    public static void main(String[] args) {
       //string->stringbuffer
        String str="hello,lize";
        //返回的StringBuffer对象，对str本身没影响
        StringBuffer strb=new StringBuffer(str);
        //方式二使用append
        StringBuffer strb1=new StringBuffer();
        strb1 =strb.append(str);

        //stringbuufer-》string
        StringBuffer strb2=new StringBuffer("韩顺平教育");
        //方式一  使用stringbuffer提供的方法 tostring

        String  s= strb2.toString();
        System.out.println();

        //使用构造器

        Scanner sca = new Scanner(System.in);
                 String input=  sca.next();
                   StringBuffer sb= new StringBuffer(input);
                 for( int i=sb.lastIndexOf(".")-3;i>0;i-=3){

                     sb.insert(i,",");

                 }
        System.out.println(sb);

    }

}
